<?php
defined('_JEXEC') or die('Restricted access');

/**
 * Description of activeDynamicContainer
 * 
 * @todo
 * 
 * 
 * @author George Zeakis<zeageorge@google.com>
 * 
 */

class activeDynamicContainer extends dynamicContainer{
    
    function __construct(array $arr=array()) {
        parent::__construct();
        $this->_container = $arr;
    }
    
    public function __invoke($meth_name='', array $meth_args=array()){
        $mName = 'func_'.(string)$meth_name;
        if (method_exists($this, $mName)){
            return $this->{$mName}($meth_args);
        } else {
            throw new Exception("Method: $meth_name does not exists in Class: ".__CLASS__);
            return ;
        }
        
    }
    
    private function func_toArray(){
        return (array)$this->_container;
    }
    
    private function func_count(){
        return count($this->_container);
    }
    
    private function func_clear(){
        $this->_container = array();
    }
    
    function __destruct() { parent::__destruct(); }
}

?>
